import Vue from 'vue'
import Vuex from 'vuex'
import order from './modules/order'
import createLogger from 'vuex/dist/logger'

Vue.use(Vuex)

let store = new Vuex.Store({
  modules: {
    order
  },
  plugins: process.env.NODE_ENV !== 'production' ? [createLogger()] : []
})
store.subscribe((mutations, state) => {
  localStorage.setItem('orderlist', JSON.stringify(state.order.list1))
})


export default store


